#include "GY_8507_Func.h"

// 这个变量用来表示打开的设备  0表示未打开 1表示周立功CAN 2表示吉阳光电
// 注意，这个变量是设备打开时才赋值，关闭时应该清零
uint16_x g_DevType_ZLG1_GY2 = 0;
uint16_x g_Channal = 0;
uint32_x g_Baud = 125000;

//这里对GY8507共享库中需要的函数进行集中管理

sfunc3  VCI_OpenDevice;
sfunc2  VCI_CloseDevice;
sfunc4  VCI_InitCAN;
sfunc3  VCI_StartCAN;
sfunc41 VCI_Transmit;
sfunc41 VCI_Receive;

const uint16_x VCI_BaudConfig[6][3] =
{
    // index
    // Kbaud  Timing0  Timing1
    { 5,      0x09,     0x1C}, //50K
    { 7,      0x04,     0x1C}, //100K
    { 8,      0x03,     0x1C}, //125K
    { 10,     0x01,     0x1C}, //250K
    { 12,     0x00,     0x1C}, //500K
    { 15,     0x00,     0x14} //1000K
};
